﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WP_GasTracker.Models;
using WP_GasTracker.Persitence;

namespace WP_GasTracker.ViewModels
{
    public class ListViewModel : ViewModel
    {
        public Notebook Entries { get; set; }

        public ListViewModel()
        {
            Entries = new Notebook();
        }

        public void Load()
        {
            var storage = new IsolatedStorageGateway();
            var entries = storage.LoadNotebook().OrderByDescending(x => x.Date);
            Entries.AddRange(entries);
        }
    }
}
